package com.imooc.validate;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.constraints.NotBlank;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author Levi
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = CheckNameValidate.class)
@NotBlank
public @interface Name {

    String message() default "name不符合要求,要求为4-12位的字母数字且不能包含空格";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};
}